package com.foxmail.aroundme.boring.module.news.joke;

import android.support.annotation.NonNull;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.foxmail.aroundme.boring.BuildConfig;
import com.foxmail.aroundme.boring.R;
import com.foxmail.aroundme.boring.bean.entry.JokeEntry;
import com.foxmail.aroundme.boring.bean.newslist.NewsListBean;
import com.foxmail.aroundme.boring.utils.Config;
import com.foxmail.aroundme.mutlitype.ItemViewProvider;
import com.socks.library.KLog;

/**
 * Created by gzl on 1/22/17.
 *
 */

public class JokeListProvider extends ItemViewProvider<JokeEntry, JokeListViewHolder>{
    @NonNull
    @Override
    protected JokeListViewHolder onCreateViewHolder(@NonNull LayoutInflater inflater, @NonNull ViewGroup parent) {

        View view = inflater.inflate(R.layout.item_joke, parent, false);


        return new JokeListViewHolder(view);
    }

    @Override
    protected void onBindViewHolder(@NonNull JokeListViewHolder holder, @NonNull JokeEntry jokeEntry) {

        if (TextUtils.isEmpty(jokeEntry.content)) {
            if (BuildConfig.DEBUG) {
                KLog.e(Config.TAG, "jokeEntry content is null");
            }
            return;
        }


        holder.joke_content.setText(jokeEntry.content);

        holder.showTime.setText(jokeEntry.upDateTime);

    }
}
